#!/bin/bash # It is recommended to test the script on a local machine for its purpose and effects. # ManageEngine Desktop Central will not be responsible for any # damage/loss to the data/setup based on the behavior of the script. # Description - Script to give admin rights to a user in Mac # Script Arguments - "" # Configuration - COMPUTER #!/bin/sh USERNAME=$1 /usr/sbin/dseditgroup -o edit -a "$USERNAME" -t user admin errcode=$? if [ "$errcode" -ne 0 ]; then echo "" echo "Failed with errorcode $errcode" 1>&2 echo "" exit 1 fi echo "Admin rights given for user $USERNAME" 1>&2